// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** createChapter POST /api/chapter/create */
export async function createChapterUsingPost(
  body: API.ChapterAddRequest,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseLong_>('/api/chapter/create', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** delChapter POST /api/chapter/del */
export async function delChapterUsingPost(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.delChapterUsingPOSTParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseBoolean_>('/api/chapter/del', {
    method: 'POST',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** getChapterById GET /api/chapter/get-by-id */
export async function getChapterByIdUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getChapterByIdUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseChapter_>('/api/chapter/get-by-id', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** listNovelAllChapter GET /api/chapter/list */
export async function listNovelAllChapterUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.listNovelAllChapterUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseListChapterVO_>('/api/chapter/list', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** listReviewingChapter GET /api/chapter/list-reviewing */
export async function listReviewingChapterUsingGet(options?: { [key: string]: any }) {
  return request<API.BaseResponseListChapterInfo_>('/api/chapter/list-reviewing', {
    method: 'GET',
    ...(options || {}),
  });
}

/** listMyNovelChapter GET /api/chapter/my-novel */
export async function listMyNovelChapterUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.listMyNovelChapterUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseListChapter_>('/api/chapter/my-novel', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** saveChapter POST /api/chapter/save */
export async function saveChapterUsingPost(
  body: API.ChapterSaveRequest,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseBoolean_>('/api/chapter/save', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** switchChapterStatus POST /api/chapter/switch */
export async function switchChapterStatusUsingPost(
  body: API.ChapterSwitchRequest,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseBoolean_>('/api/chapter/switch', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
